/* eslint-disable no-undef */
import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/admservice/adm-superadministrator/adminLogin',
    method: 'post',
    data
  })
}
export function loginTwo(admin) {
  return request({
    url: `/admservice/adm-superadministrator/adminLoginTwo`,
    method: 'post',
    data:admin
  })
}


export function getInfo(token) {
  return request({
    url: '/admservice/adm-superadministrator/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/admservice/adm-superadministrator/logout',
    method: 'post'
  })
}

// 条件查询带分页的方法
export function findAllTeacher(page, limit, teacherQuery) {
  return request({
    url: `/admservice/adm_teacher/pageTeacherCondition/${page}/${limit}`,
    method: 'post',
    data: teacherQuery
  })
}
//禁用教师账号
  export function disableTeacher(jobNumber){
    return request({
      url: `/admservice/adm_teacher/disable/${jobNumber}`,
      method:'post'
    })
}
//删除教师信息
export function deleteTeacher(jobNumber) {
    return request({
      url: `/admservice/adm_teacher/${jobNumber}`,
      method: 'delete',
    })
}
//添加教师信息
export function addTeacher(teacher) {
  return request({
    url: `/admservice/adm_teacher/addTeacher`,
    method: 'post',
    data: teacher
  })
}
// 对教师的信息进行回显操作
export function getInfoTeacher(id) {
  return request({
    url: `/admservice/adm_teacher/echoDate/${id}`,
    method: 'get',
  })
}
//修改教师信息
export function updateTeacher(teacher,id) {
  return request({
    url: `/admservice/adm_teacher/updateTeacher/${id}`,
    method: 'post',
    data: teacher
  })
}
// 路由守卫，判断是不是超级管理员
export function checkIfSuperAdmin() {
  return new Promise((resolve, reject) => {
    request({
      url: `/admservice/adm-superadministrator/checkIfSuperAdmin`,
      method: 'post',
    }).then(response => {
      resolve(response);
    }).catch(error => {
      reject(error);
    });
  });
}
// 审核员条件查询带分页的方法
export function findAllSuper(page, limit, adminSuperQuery) {
  return request({
    url: `/admservice/adm-superadministrator/findAllSuper/${page}/${limit}`,
    method: 'post',
    data: adminSuperQuery
  })
}
//删除审核员信息
export function deleteSuper(jobNumber) {
  return request({
    url: `/admservice/adm-superadministrator/deleteSuper/${jobNumber}`,
    method: 'delete',
  })
}
//添加审核员
export function addSuper(superAll) {
  return request({
    url: `/admservice/adm-superadministrator/addSuper`,
    method: 'post',
    data: superAll
  })
}
//修改审核员信息
export function updateSuper(superAll,id) {
  return request({
    url: `/admservice/adm-superadministrator/updateSuper/${id}`,
    method: 'post',
    data: superAll
  })
}
// 对审核员的信息进行回显操作
export function getInfoSuper(id) {
  return request({
    url: `/admservice/adm-superadministrator/getInfoSuper/${id}`,
    method: 'get',
  })
}
// 找到所有的学院
export function findAllCategory() {
  return request({
    url: `/admservice/adm-superadministrator/findAllCategory`,
    method: 'get',
  })
}
// 删除指定学院
export function categoryDeleteById(id) {
  return request({
    url: `/admservice/adm-superadministrator/categoryDeleteById/${id}`,
    method: 'delete',
  })
}
// 添加学院
export function categoryAdd(value) {
  return request({
    url: `/admservice/adm-superadministrator/categoryAdd/${value}`,
    method: 'post',
  })
}
// 找到所有的材料分类
export function findAllBus() {
  return request({
    url: `/admservice/adm-superadministrator/findAllBus`,
    method: 'get',
  })
}
// 添加教师提交材料分类
export function busAdd(value1,value2) {
  return request({
    url: `/admservice/adm-superadministrator/busAdd/${value1}/${value2}`,
    method: 'post',
  })
}
// 删除教师提交材料分类
export function busDeleteById(id) {
  return request({
    url: `/admservice/adm-superadministrator/busDeleteById/${id}`,
    method: 'delete',
  })
}
// 查询项目申报类别
export function findAllApplication() {
  return request({
    url: `/admservice/adm-superadministrator/findAllApplication`,
    method: 'get',
  })
}
// 删除项目申报类别
export function applicationDeleteById(id) {
  return request({
    url: `/admservice/adm-superadministrator/applicationDeleteById/${id}`,
    method: 'delete',
  })
}

// 添加项目申报类别
export function applicationAdd(value1,value2) {
  return request({
    url: `/admservice/adm-superadministrator/applicationAdd/${value1}/${value2}`,
    method: 'post',
  })
}
//首页显示姓名
export function getName() {
  return request({
    url: `/admservice/adm-superadministrator/getName`,
    method: 'get',
  })
}
// 退出
export function logOut() {
  return request({
    url: `/admservice/adm-superadministrator/logOut`,
    method: 'post'
  })
}
// 考勤迟到未签教师管理
export function findAllSign(page, limit, adminSuperQuery) {
  return request({
    url: `/admservice/adm-superadministrator/findAllSign/${page}/${limit}`,
    method: 'post',
    data: adminSuperQuery
  })
}
//代签管理
export function updateSign(jobNumber) {
  return request({
    url: `/admservice/adm-superadministrator/updateSign/${jobNumber}`,
    method: 'post',
  })
}
// 考勤所有教师管理
export function findAllSignPeople(page, limit, adminSuperQuery) {
  return request({
    url: `/admservice/adm-superadministrator/findAllSignPeople/${page}/${limit}`,
    method: 'post',
    data: adminSuperQuery
  })
}
//人脸识别登录
export function faceLogin(img) {
  return request({
    url: '/admservice/timesystem/faceLogin',
    method: 'post',
    headers: {
      'Content-Type': 'application/json',  // 设置请求头，表明正在发送JSON数据
    },
    data: JSON.stringify(img)  // 将数据对象转换为JSON字符串
  })
}
